'<?php
namespace App\Api\Transformers;


use App\Master;
use League\Fractal\TransformerAbstract;

/**
 * Class MasterTransformer
 * @package App\Api\Transformers
 */
class MasterTransformer extends TransformerAbstract
{
    /**
     * @param Master $master
     * @return array
     */
    public function transform(Master $master)
    {
        $avatarUrl = "http://yuejian.app/uploads/avatars/";
        return [
            'master_id' => $master['id'],
            'master_name' => $master['master_name'],
            'master_avatar' => $avatarUrl.$master['master_avatar']
        ];
    }
}